﻿<UserControl x:Class="CredentialsManager.Views.ServiceView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:h="clr-namespace:CredentialsManager.Helpers"
             xmlns:wi="clr-namespace:CredentialsManager.Controls.WorkingImage"        
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid Panel.ZIndex="2"
              HorizontalAlignment="Center" 
              VerticalAlignment="Center"
              Style="{StaticResource HideIfNotLoadingStyle}">
            <wi:WorkingImage />
        </Grid>
        <DockPanel LastChildFill="True" Panel.ZIndex="1">
            <Grid DockPanel.Dock="Top" Margin="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Label Grid.Column="0" Margin="0, 5, 0, 5">Service Url:</Label>
                <TextBox Grid.Column="1" Margin="0, 5, 5, 5" Text="{Binding ServiceUriText, UpdateSourceTrigger=PropertyChanged}" />
                <Button Grid.Column="2" Padding="3" Margin="2" Command="{Binding ViewCommand}" IsEnabled="{Binding IsUriValid}">View</Button>
                <Button Grid.Column="3" Padding="3" Margin="2" Command="{Binding SelectCommand}" IsEnabled="{Binding IsUriValid}">Select</Button>
            </Grid>
            <WebBrowser h:WebBrowserUtility.BindableSource="{Binding ServiceUri, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Margin="5" />
        </DockPanel>
    </Grid>
</UserControl>